Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added ReportedAt time for server mode reports - fixes #928 #996

Merged
merged 1 commit into from
Jun 11, 2020
Merged

Added ReportedAt time for server mode reports - fixes #928 #996

merged 1 commit into from
Jun 11, 2020

Conversation

ahulab
Copy link
Contributor

@ahulab ahulab commented Jun 8, 2020

What did you implement:

Added ReportedAt time for reports submitted from client while server is running in server mode. I know that there is already a PR (#938) open for this, but it doesn't look like it's in progress and this is a fix that is impacting my use of Vuls. I can be active and make changes if requested, please let me know.

Fixes #928

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Yes, see verification steps at the end of the PR

Checklist:

You don't have to satisfy all of the following.

  • Write tests

  • Write documentation

  • Check that there aren't other open pull requests for the same issue/feature
    there is an open pull request, but it doesn't look active: Set ReportedAt as time.Now #938

  • Format your source code by make fmt

  • Pass the test by make test

  • Provide verification config / commands

  • Enable "Allow edits from maintainers" for this PR

  • Update the messages below

Is this ready for review?: YES

To verify

  • Create data.json file in your current directoy
{
  "family": "centos",
  "release": "6.9",
  "runningKernel": {
    "release": "2.6.32-696.6.3.el6.x86_64",
    "version": "",
    "rebootRequired": false
  },
  "packages": {
    "ntp": {
      "name": "ntp",
      "version": "4.2.6p5",
      "release": "10.el6.centos.2",
      "arch": "x86_64"
    },
    "openssh": {
      "name": "openssh",
      "version": "5.3p1",
      "release": "122.el6",
      "arch": "x86_64"
    }
  }
}
  • After starting vuls, run these two commands from your CLI, you should see that the time reported is the current time, not the epoch
# json
curl -s -X POST -H "Content-Type: application/json" -d ./data.json http://localhost:5515/vuls | jq '.[] | {reportedAt}'

# text
curl -X POST -H "Content-Type: text/plain" -H "X-Vuls-Server-Name: foo" -H "X-Vuls-OS-Family: centos" -H "X-Vuls-OS-Release: 6.9" -H "X-Vuls-Kernel-Release: 2.6.32-695.20.3.el6.x86_64" --data-binary "" http://localhost:5515/vuls |  jq '.[] | {reportedAt}'

Reference

@kotakanbe kotakanbe merged commit 519fb19 into future-architect:master Jun 11, 2020
@kotakanbe
Copy link
Member

@ahulab Many thanks :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ReportedAt is not written json report that is stored with one-liner scan
2 participants